package com.grf.rocketmq.listener;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@RocketMQMessageListener(topic = "test", consumerGroup = "test_group")
public class MyConsumer implements RocketMQListener<String> {


    @Override
    public void onMessage(String message) {
       // 消费消息
       log.info("message is: {}", message);
    }
}
